package secondkill.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import secondkill.rabbtmq.MQSender;

@Controller
@Slf4j
public class RabbitMQController {
    @Autowired
    private MQSender mqSender;

/*    //Fanout模式
    @RequestMapping("/fanout")
    @ResponseBody
    public void RabbitMQFanout(){
        mqSender.send_Fanout("HELLO Fanout");
    }

    //Direct模式
    @RequestMapping("/direct01")
    @ResponseBody
    public void RabbitMQDirect01(){
        mqSender.send_Direct01("HELLO Direct");
    }
    @RequestMapping("/direct02")
    @ResponseBody
    public void RabbitMQDirect02(){
        mqSender.send_Direct02("HELLO Direct");
    }
    //Topic模式
    @RequestMapping("/topic01")
    @ResponseBody
    public void RabbitMQTopic01(){
        mqSender.send_Topic01("HELLO Topic");
    }
    @RequestMapping("/topic02")
    @ResponseBody
    public void RabbitMQTopic02(){
        mqSender.send_Topic02("HELLO Topic");
    }
    //Headers模式
    @RequestMapping("/headers01")
    @ResponseBody
    public void RabbitMQHeaders01(){
        mqSender.send_Headers01("HELLO Headers");
    }
    @RequestMapping("/headers02")
    @ResponseBody
    public void RabbitMQHeaders02(){
        mqSender.send_Headers02("HELLO Headers");
    }*/
}
